home *** CD-ROM | disk | FTP | other *** search
- /* copy mail received by AmigaNOS ready for elm, run AmigaElm and */
- /* then return return the fiile ready for nos to append to the end */
-
- SiteName = 'video.demon.co.uk'/* Full Domain Path */
- mqueue = 'slip:spool/mqueue/' /* MUST END IN SLASH */
- uuspool = 'uuspool:' /* UUCp Spool Dir */
- yourfeed = 'gate.demon.co.uk' /* DO NOT CHANGE! */
- rqueue = 'slip:spool/mail/' /* MUST END IN SLASH */
- findfile = 't:ProcMail'
-
- say 'Checking for new Mail Postings'
-
- /* Gate Local Mail Items to the Internet via AmigaNOS */
-
- /*
- * Format of the files in the mqueue library are as follows...
- *
- * <seq>.txt contains the header and body of the message
- * <seq>.wrk contains the information for SMTP
- *
- * A typical entry for <seq>.wrk would look like this...
- *
- * <1> gate.demon.co.uk <your feed site>
- * <2> mlednor@tower.demon.co.uk <from who?>
- * <3> mlednor@cix.compulink.co.uk <destination user>
- *
- */
-
-
- seqfile = mqueue || 'sequence.seq'
-
- if open( seqfile, seqfile, 'R' ) == 0 then sequence = 1
- else
- do
- sequence = ''
- sequence = readln( seqfile )
- if sequence = '' then sequence = 1
- end
-
- dummy = close( seqfile )
-
- dummy = addlib( "rexxsupport.library", 0, -30, 0 )
-
- dirstring = showdir( uuspool, 'F' )
- olddirstr = dirstring
-
- do forever
- parse var dirstring filename dirstring
-
- if filename == '' then leave
- if upper(substr( filename, 1, 7 )) ~= 'D.GATEX' then iterate
-
- filename = uuspool || filename
-
- if ~open( filename, filename, 'R' ) then iterate
-
- line.1 = readln( filename )
- line.2 = readln( filename )
- line.3 = readln( filename )
- line.4 = readln( filename )
-
- dummy = close( filename )
-
- if line.1 == '' || line.2 == '' || line.3 == '' || line.4 == '' then iterate
-
- parse var line.4 junk junk sendlist
-
- do forever
-
- if sendlist == '' then leave
-
- parse var sendlist touser sendlist
-
- touser = strip( touser )
- fromuser = subword( line.1, 2, 1 ) || '@' || sitename
-
- textfile = substr( filename, 1, 6 + length( uuspool )) || 'B'
- textfile = textfile || substr( filename, 8 + length( uuspool ) )
-
- if ~open( textfile, textfile, 'R' ) then iterate
-
- sequence = sequence + 1
-
- outwrk = mqueue || sequence || '.wrk'
- outtxt = mqueue || sequence || '.txt'
- say 'working on sequence' sequence
-
- if ~open( outwrk, outwrk, 'W' ) then do
- dummy = close( textfile )
- iterate
- end
-
- dummy = writeln( outwrk, yourfeed )
- dummy = writeln( outwrk, fromuser )
- dummy = writeln( outwrk, touser )
-
-
- if ~open( outtxt, outtxt, 'W' ) then do
- address command 'delete >nil:' outwrk
- dummy = close( textfile )
- iterate
- end
-
-
- do forever
-
- itemline = readln( textfile )
- if eof( textfile ) then leave
-
- if substr( itemline, 1, 5 ) == 'From ' then /* Junk the */
- iterate /* 'From ' line */
-
- dummy = writeln( outtxt, itemline )
- end
-
-
- dummy = close( outtxt )
- dummy = close( outwrk )
-
- dummy = close( textfile )
-
-
- end
-
- end
-
-
- if open( seqfile, seqfile, 'W' ) == 0 then do
- say 'Couldn''t open sequence file for Rewrite.'
- exit 10
- end
-
- dummy = writeln( seqfile, sequence )
-
- dummy = close( seqfile )
-
-
- filename = ''
-
- do forever
- parse var olddirstr filename olddirstr
- if filename == '' then leave
- if upper( substr( filename, 2, 5 ) ) ~= ".GATE" then iterate
-
- address command 'delete >nil:' uuspool || filename
- end
-
- exit
-